import request from "@/utils/request";

// 登录
export const LoginApi = (data) => {
  return request.post('/login', data)
}
export const listApi = () => {
  return request.get('/menus')
}
//获取-用户列表
export const getUserApi = (obj) => {
  return request.get('/users', {
    params: obj
  })
}
//删除
export const DelUserApi = id => {
  return request.delete('/users/' + id)
}
// 编辑
export const updateUser = data => {
  return request.put('/users/' + data.id, data)
}
// 添加
export const addUserApi = (data) => {
  return request.post('/users', data)
}
//获取-用户详情
export const getUserx = (id) => {
  return request.get('/users/' + id)
}
//分配-用户权限
export const xiugaiUser = obj => {
  return request.put('/users/' + obj.id + '/role', { data: { rid: obj.rid } })
}

//修改用户状态
export const zhuantaiUser = obj => {
  return request.put('/users/' + obj.id + '/state/' + obj.bool)
}